<template>
  <view class="container">
    <headers title='个人中心'></headers>

    <!-- 用户标签 -->
    <view class="user_tag">
      <view class="user_img">
        <cover-image src="../../static/img/tx.jpg"></cover-image>
        <view>
          <view class="user_name">用户姓名 </view>
          <text class="user_ipone">1572328932</text>
        </view>
      </view>
      <view class="user_sf">
        <view class="user_sfrz">
          <view class="button">身份认证</view>
          <text>获得平台专属资格</text>
        </view>
        <view class="user_jf">
          <view class="">
            剩余积分
            <view class="jifen">
              2189
            </view>
          </view>
          <view class="">
            >
          </view>
        </view>
      </view>
    </view>

    <!-- 我的订单 -->
    <view class="my_order">
      <view class="my_order_dd">
        <text>我的订单</text>
        <text class="quanbu">全部订单 ></text>
      </view>
      <view class="my_order_list">
        <view v-for="item in 5">
          <image src="../../static/img/gyx.png" mode=""></image>
          <view>代发货</view>
        </view>
      </view>
    </view>

    <!-- 我的资料 -->
    <view class="my_information">
      <view class="my_bottom" v-for="item in 3">
        <view class="">
          <image src="../../static/img/gy.png" mode=""></image>
          <text>我的资料</text>
        </view>
        <text class="jiantou">></text>
      </view>
    </view>
  </view>
</template>

<script>
  import headers from '../../components/headers/headers.vue'
  import {
    request
  } from "@/request/index.js"
  import tabBar from '@/components/tabBar/tabBar.vue'
  export default {

    data() {
      return {
        title: '首页',
        loading: true,
        user: {}
      }
    },
    components: {

    },
    // onShow() {
    // 	let token = wx.getStorageSync("token");
    // 	if (token == null || token == undefined || !token || token == "") {
    // 		uni.showToast({
    // 			title: "您未登录请先登录",
    // 			icon: "none",
    // 			duration: 1500,
    // 			success: (res) => {
    // 				uni.navigateTo({
    // 					url:"/pages/login/login"
    // 				})
    // 			}
    // 		})
    // 	} else {
    // 		this.GetUserInfo() 
    // 	}
    // },
    onLoad() {
      let token = wx.getStorageSync("token");
      // if (token == null || token == undefined || !token || token == "") {
      // 	uni.showToast({
      // 		title: "您未登录请先登录",
      // 		icon: "none",
      // 		duration: 1500,
      // 		success: (res) => {
      // 			uni.navigateTo({
      // 				url: "/pages/login/login"
      // 			})
      // 		}
      // 	})
      // } else {
      // 	this.GetUserInfo()
      // }
    },
    methods: {
      // 退出
      GetExit() {
        uni.removeStorageSync('token');
        uni.navigateTo({
          url: "/pages/login/login"
        })
      },
      // 跳转链接
      GetUrl(e) {
        if (e == 1) {
          uni.navigateTo({
            url: "/pages/my/mytask"
          })
        }

        if (e == 3) {
          uni.navigateTo({
            url: "/pages/my/mycase"
          })
        }

        if (e == 4) {
          uni.navigateTo({
            url: "/pages/my/updatepwd"
          })
        }
      },
      // 获取用户信息
      async GetUserInfo() {

        var res = await request({
          url: "GetUserInfo"
        })
        console.log(res);
        if (res.code == 0) {

          this.user = res.data
        }

      },

      getmod() {
        uni.navigateTo({
          url: '/pages/my/modify'
        })
      }
    }
  }
</script>

<style scoped lang="scss">
  // .container {
  //   height: 1600rpx;
  //   background-color: #F4F4F4;
  // }

  // 用户标签
  .user_tag {
    margin: 40rpx auto 20rpx;
    width: 686rpx;
    height: 318rpx;
    background: linear-gradient(135deg, #AACBFF 0%, #D5E8FF 49%, #AACBFF 100%);
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    opacity: 1;

    .user_img {
      padding: 40rpx 0 0 30rpx;
      display: flex;
      align-items: center;
      padding-bottom: 40rpx;

      cover-image {
        margin-right: 20rpx;
        width: 120rpx;
        height: 120rpx;
        border-radius: 50%;
        opacity: 1;
        border: 4rpx solid #FFFFFF;
      }

      .user_name {
        margin-bottom: 16rpx;
        width: 128rpx;
        height: 32rpx;
        font-size: 32rpx;
        font-weight: bold;
        color: #333333;
      }

      .user_ipone {
        width: 186rpx;
        font-size: 28rpx;
        font-weight: 500;
        color: #666666;
      }

    }

    .user_sf {
      display: flex;
      padding: 15rpx 0 15rpx 30rpx;
      background: rgba(255, 255, 255, 0.3);

      .user_sfrz {
        width: 340rpx;
        border-right: 2rpx solid rgba(113, 169, 253, 0.2);

        .button {
          margin-bottom: 10rpx;
          text-align: center;
          width: 164rpx;
          line-height: 44rpx;
          background: #3369FF;
          border-radius: 22rpx 22rpx 22rpx 22rpx;

          font-size: 24rpx;
          font-weight: bold;
          color: #FFFFFF;
        }
      }

      .user_jf {
        width: 340rpx;
        padding: 0 30rpx 0 40rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;

        .jifen {
          margin-top: 10rpx;
          width: 96rpx;
          height: 34rpx;
          font-size: 40rpx;
          font-weight: bold;
          color: #27314E;
          line-height: 40rpx;
        }
      }
    }
  }

  // 我的订单
  .my_order {
    margin: auto;
    padding: 30rpx;
    width: 686rpx;
    height: 206rpx;
    background: #fff;
    border-radius: 16rpx 16rpx 16rpx 16rpx;

    .my_order_dd {
      display: flex;
      justify-content: space-between;

      .quanbu {
        font-size: 24rpx;
        font-weight: 500;
        color: #999999;
      }
    }

    .my_order_list {
      padding-top: 32rpx;
      display: flex;
      justify-content: space-around;
      text-align: center;

      image {
        padding-bottom: 10rpx;
        width: 44rpx;
        height: 44rpx;
      }

      view view {
        font-size: 24rpx;
        font-weight: 500;
        color: #333333;
      }
    }
  }

  // 我的资料
  .my_information {
    margin: 20rpx auto;
    padding: 0 30rpx;
    width: 686rpx;
    height: 288rpx;
    background: #fff;
    border-radius: 16rpx 16rpx 16rpx 16rpx;

    .my_bottom {
      display: flex;
      justify-content: space-between;
      padding: 28rpx 0;
      border-bottom: 2rpx solid #EEEEEE;

      image {
        width: 36rpx;
        height: 36rpx;
        vertical-align: middle;
      }

      .jiantou {
        color: #999;
      }

      view text {
        margin-left: 10rpx;
        width: 112rpx;
        line-height: 22rpx;
        font-size: 28rpx;
        font-weight: 500;
        color: #333333;
      }
    }
  }
</style>